/**
 * Created by Administrator on 2016/4/27 0027.
 */
document.write("<script language='javascript' src='/resources/js/views/defineTable.js'></script>");
document.write("<script language='javascript' src='/resources/js/load/loadArea.js'></script>");
document.write("<script language='javascript' src='/resources/js/load/loadIndicatorFromsType.js'></script>");
document.write("<script language='javascript' src='/resources/js/query/queryReportByAreaAndIndicator.js'></script>");
var page = 1;
var pageSize = 30;
var years="../report/query/allYear.do";
var allCity="/area/query/selfCity.do";
var ttIndicatorSelectCache= [];

function query() {
	queryByFormsInameAreaIndicatorType(page,pageSize,ENUM_AREA_CITY, ttIndicatorSelectCache);
}

function queryList() {
	queryByFormsInameAreaIndicators(page, pageSize,ENUM_AREA_CITY, ttIndicatorSelectCache);
}

var show = {
	tableshow:function () {
		this.a = !this.a;
		if(this.a){
			$("#tableView").panel("collapse",true);
		}else{
			$("#tableView").panel("expand",true);
		}
	},
	photoshow:function () {
		this.b = !this.b
		if(this.b){
			$("#annualAnalysis_chart").panel("collapse",true);
		}else{
			$("#annualAnalysis_chart").panel("expand",true);
		}
	}
}

$(function(){

	ttIndicatorSelectCache=[];
	onlyLoadYear();
	loadFormAndOnlyIndicatorType();
	loadCityDepart();

	$('#iname').textbox({prompt:'指标输入'});
	$("#tabDiv").css("height","60px !important");
	$('#tabDiv').tabs({
	    onSelect:function(title,index){
			if(index==0){
				var time= setTimeout(function(){
					showData(zbname, series, jsonXData,conceal,isShow);
				},10);
			}else if(index==1){
				var time= setTimeout(function(){
					$("#tabDiv").height("370px");
					var yeares =$('#comboboxYear').combobox('getText');
					var yearList= [];
					if(yeares!=null ||yeares!='' || yeares!=undefined){
						yearList=yeares.split(',');
					}
					showImage(yearList.length-1)
				},10);
			}
	    }
	});
});

function Save_Excel() {//导出Excel文件
	var grid = $("#annualAnalysis_tt");
	// var rows=grid.datagrid("getRowss");					  //获得表格行数据 getRowss
	var name='地市领域分析';
	var colums_all=grid.datagrid("options").columns;      		     //获得表格的所有列不包括冻结列
	var columses=[];
	var columss=[];
	for (var i = 1; i < colums_all[0].length; i++) {
		columss.push(colums_all[0][i]);
	}
	columses[0]=columss;
	getSelections = grid.datagrid("getSelections");     //获得表格选中行数据 getSelections
	var obj = $.ExportExcelDlg({
		HeadInfo: columses,    //表头栏
		RowInfo: getSelections,		   //数据航
		FooterInfo: grid.datagrid("getFooterRows"),
		RowStart: 2,		   //导出行位置
		ColumStart: 2,		   //导出列位置
		SheetName: name,
		MainTitle: { Displayname: name, Alignment: 'Center' },
		SaveName: name,
		Swf: 'ExportExcel.swf'
	});
	obj.ExportExcelDlg('open');
}